<template>
    <div style="height: 100%;background: #F7F7F7;">
      <!-- <div> -->
		<div class="cellline mt-20">
			<div class="lineleft">账号名称</div>
			<div class="lineright">
				<span class="rightname">{{name}}</span>
			</div>
		</div>
		<div class="cellline" @click="perfect()">
			<div class="lineleft">个人资料</div>
			<div class="lineright">
				<span class="rightname">点击完善</span>
				<img src="../../../src/assets/img/my-left.png" alt="">
			</div>
		</div>
		<div class="cellline" @click="thr()">
			<div class="lineleft">第三方授权绑定</div>
			<div class="lineright">
				<span class="rightname">查看</span>
				<img src="../../../src/assets/img/my-left.png" alt="">
			</div>
		</div>
		<div class="cellline mt-20" @click="newpass()">
			<div class="lineleft">登陆密码设置</div>
			<div class="lineright">
				<span class="rightname"></span>
				<img src="../../../src/assets/img/my-left.png" alt="">
			</div>
		</div>
      <!-- </div> -->
			<!-- 更换手机号 -->
		<div class="shoewr-chenhoupass">
			<div class="chen-contener chenpass">
				<p class="chen-title">提示</p>
				<p class="chen-text chen-textactive">{{texttitle}}</p>
				<div class="chen-but">
					<p class="chen-but-no" @click="repeatclose()">取消</p>
					<p class="chen-but-yes" @click="repeatclick()">{{text}}</p>
				</div>
			</div>
		</div>
    </div>
</template>

<script>
	import { MessageBox } from 'mint-ui';
    export default {
        name: "Center",
      data(){
          return{
            name:'',
			is_password:'',
			tel:'',
			texttitle:'您需要更换登陆密码吗？',
			text:'去更换',
          }
      },
      methods:{
			repeatclose(){
				$('.shoewr-chenhoupass').fadeOut();
			},
			repeatclick(){
				var is_password = this.is_password;
				if(is_password==0||is_password=='0'){   //设置密码
					this.$router.push({
						path:'/newpassword',
						query:{
							type:2,
							tel:this.tel
						}
					})
				}else{
					this.$router.push({
						path:'/newpassword',
						query:{
							type:1,
							tel:this.tel
						}
					})
				}
			},
			// 登陆密码设置
			  newpass(){
					var is_password = this.is_password;
					if(is_password==0||is_password=='0'){   //设置密码
						$('.shoewr-chenhoupass').fadeIn();
						this.texttitle = '您还未设置密码，是否设置密码';
						this.text = '去设置';
					}else{
						$('.shoewr-chenhoupass').fadeIn();
						this.texttitle = '您需要更换登陆密码吗？';
						this.text = '去更换';
					}
				},
          ka(){
            this.$router.push({
              path:'/ka'
            })
          },
        thr(){
          this.$router.push({
            path:'/bangding'
          })
        },
        quit(){
          localStorage.clear();
          sessionStorage.clear();
          this.$router.push({
            path:'/user'
          })
        },
        perfect(){
          this.$router.push({
            path:'/people'
          })
        }
      },
      mounted() {
		  this.sdk.getJSSDK('','',this.$store.state.url);	
          this.axios.get(this.$store.state.url + "User/getUserInfo").then(res=>{
				if (res.data.errcode == 0||res.data.errcode == '0'){
					var data = res.data.data;
					this.is_password = data.is_password;  // 是否设置登陆密码  1是
					if (data.is_band_wechat==1||data.is_band_wechat=='1'){
						this.name = data.nickname+'('+'ID:'+data.id+')';
					}else if(data.is_band_qq==1||data.is_band_qq=='1'){
						this.name = data.nickname1+'('+'ID:'+data.id+')';
					}else{
						var tel = data.tel;
						this.name = tel.substr(0,3) + "****" + tel.substr(7)+'('+'ID:'+data.id+')';
					}
					this.tel = data.tel;
				}
			})

      },
    }
</script>

<style scoped>
	.mt-20{
		margin-top: .3rem;
	}
	.cellline{
		line-height: .9rem;
		width: 7.5rem;
		background: #fff;
		display: flex;
		justify-content: space-between;
	}
	.lineleft{
		padding-left: .3rem;
		color: #333333;
		font-size: .3rem;
	}
	.lineright{
		padding-right: .3rem;
		color: #999999;
		font-size: .26rem;
	}
	.lineright img{
		width: .1rem;
		height: .2rem;
		margin-top: .35rem;
		margin-left: .3rem;
	}
   .mt{
     margin-top: 0.2rem;
   }
  .btnnn{
    width: 92%;
    position: absolute;
    bottom: 0.5rem;
   left: 4%;
  }
</style>
